﻿<?xml version="1.0" encoding="utf-8"?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c4fConverters="using:Coding4Fun.Toolkit.Controls.Converters" xmlns:local="using:Coding4Fun.Toolkit.Controls" xmlns:system="using:System">
  <!--WindowsStore-->
  <ResourceDictionary.ThemeDictionaries>
    <ResourceDictionary x:Key="Default" />
    <ResourceDictionary x:Key="Light" />
    <ResourceDictionary x:Key="HighContrast" />
  </ResourceDictionary.ThemeDictionaries>
  <c4fConverters:SolidColorBrushToColorConverter x:Key="BrushToBrush" />
  <SolidColorBrush x:Key="DefaultAccentBrush" Color="#0050EF" />
  <SolidColorBrush x:Key="DefaultChromeBrush" Color="#1F1F1F" />
  <SolidColorBrush x:Key="DefaultBackgroundBrush" Color="#000000" />
  <SolidColorBrush x:Key="DefaultForegroundBrush" Color="#FFFFFF" />
  <SolidColorBrush x:Key="DefaultSubtleBrush" Color="#99FFFFFF" />
  <SolidColorBrush x:Key="DefaultDisabledBrush" Color="#6FFF" />
  <SolidColorBrush x:Key="DefaultContrastDisabledBrush" Color="#1F1F1F" />
  <x:Double x:Key="DefaultFontSizeExtraSmall">12</x:Double>
  <x:Double x:Key="DefaultFontSizeNormal">20</x:Double>
  <x:Double x:Key="DefaultFontSizeMedium">22.667</x:Double>
  <x:Double x:Key="DefaultFontSizeMediumLarge">25.333</x:Double>
  <x:Double x:Key="DefaultFontSizeLarge">32</x:Double>
  <FontFamily x:Key="FontFamilySegoeNormal">Segoe UI</FontFamily>
  <FontFamily x:Key="FontFamilySegoeSemiBold">Segoe UI Semibold</FontFamily>
  <FontFamily x:Key="FontFamilySegoeSemiLight">Segoe UI SemiLight</FontFamily>
  <x:Double x:Key="DefaultAppButtonSize">72</x:Double>
  <x:Double x:Key="DefaultTileSize">173</x:Double>
  <Thickness x:Key="DefaultTextBoxInnerMargin">1,2</Thickness>
  <Thickness x:Key="DefaultBorderThickness">3</Thickness>
  <SolidColorBrush x:Key="DefaultSemiTransparentBrush" Color="{Binding Source={StaticResource DefaultChromeBrush}, Converter={StaticResource BrushToBrush}, ConverterParameter=99}" />
  <SolidColorBrush x:Key="DefaultTextBoxBrush" Color="{Binding Source={StaticResource TextBoxBackgroundThemeBrush}, Converter={StaticResource BrushToBrush}}" />
  <SolidColorBrush x:Key="DefaultTextBoxForegroundBrush" Color="{Binding Source={StaticResource TextBoxForegroundThemeBrush}, Converter={StaticResource BrushToBrush}}" />
  <SolidColorBrush x:Key="DefaultTextBoxReadOnlyBrush" Color="{Binding Source={StaticResource DefaultSubtleBrush}, Converter={StaticResource BrushToBrush}}" />
  <SolidColorBrush x:Key="DefaultTextBoxEditBackgroundBrush" Color="{Binding Source={StaticResource DefaultChromeBrush}, Converter={StaticResource BrushToBrush}}" />
  <SolidColorBrush x:Key="DefaultTextBoxEditBorderBrush" Color="{Binding Source={StaticResource DefaultAccentBrush}, Converter={StaticResource BrushToBrush}}" />
  <ControlTemplate x:Key="DisabledChatBubbleTextBoxTemplate" TargetType="TextBox">
    <ContentControl x:Name="ContentElement" BorderThickness="0" Margin="{TemplateBinding Margin}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
  </ControlTemplate>
  <GridLength x:Key="GridMinimized">48</GridLength>
  <c4fConverters:StringToVisibilityConverter x:Key="StringVisibilityConverter" />
  <c4fConverters:BooleanToVisibilityConverter x:Key="BoolVisibilityConverter" />
  <Style x:Key="AppBarText" TargetType="ContentControl">
    <Setter Property="HorizontalAlignment" Value="Center" />
    <Setter Property="Margin" Value="0" />
  </Style>
  <Style TargetType="local:ImageTile">
    <Setter Property="Background" Value="{StaticResource DefaultAccentBrush}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultForegroundBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource FontFamilySegoeSemiBold}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSizeNormal}" />
    <Setter Property="Margin" Value="10" />
    <Setter Property="Padding" Value="10,0" />
    <Setter Property="VerticalAlignment" Value="Top" />
    <Setter Property="HorizontalAlignment" Value="Right" />
    <Setter Property="MinWidth" Value="36" />
    <Setter Property="MinHeight" Value="36" />
    <Setter Property="Width" Value="{StaticResource DefaultTileSize}" />
    <Setter Property="Height" Value="{StaticResource DefaultTileSize}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:ImageTile">
          <Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Background="{TemplateBinding Background}">
            <Grid x:Name="ImageContainer" />
            <ContentControl Content="{TemplateBinding Content}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" FontWeight="{TemplateBinding FontWeight}" />
            <ContentControl Content="{TemplateBinding Label}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" FontWeight="{TemplateBinding FontWeight}" VerticalAlignment="Bottom" HorizontalAlignment="Left" Padding="10, 0, 0, 10" Margin="0, 0, 0, -5" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:OpacityToggleButton">
    <Setter Property="Foreground" Value="{StaticResource DefaultForegroundBrush}" />
    <Setter Property="Background" Value="{StaticResource DefaultForegroundBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource FontFamilySegoeSemiBold}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSizeExtraSmall}" />
    <Setter Property="ButtonWidth" Value="{StaticResource DefaultAppButtonSize}" />
    <Setter Property="ButtonHeight" Value="{StaticResource DefaultAppButtonSize}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:OpacityToggleButton">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CheckStates">
                <VisualState x:Name="Checked">
                  <Storyboard>
                    <DoubleAnimation Duration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" To="{Binding CheckedOpacity, RelativeSource={RelativeSource TemplatedParent}}" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ContentHost" />
                    <DoubleAnimation Duration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" To="{Binding CheckedOpacity, RelativeSource={RelativeSource TemplatedParent}}" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledContentHost" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unchecked">
                  <Storyboard>
                    <DoubleAnimation Duration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" To="{Binding UncheckedOpacity, RelativeSource={RelativeSource TemplatedParent}}" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ContentHost" />
                    <DoubleAnimation Duration="{Binding AnimationDuration, RelativeSource={RelativeSource TemplatedParent}}" To="{Binding UncheckedOpacity, RelativeSource={RelativeSource TemplatedParent}}" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledContentHost" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Indeterminate" />
              </VisualStateGroup>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="EnabledBackground">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DisabledBackground">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Name="EnabledBackground" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Padding="{TemplateBinding Padding}" BorderThickness="0" BorderBrush="Transparent" Background="Transparent">
              <StackPanel Orientation="{TemplateBinding Orientation}">
                <Grid Width="{TemplateBinding ButtonWidth}" Height="{TemplateBinding ButtonHeight}" Margin="0,-10, 0, 0">
                  <Grid Name="ContentHost">
                    <ContentControl Name="EnabledContent" Foreground="{TemplateBinding Background}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
                      <Grid Name="EnabledHolder">
                        <ContentControl Name="ContentBody" Content="{TemplateBinding Content}" />
                      </Grid>
                    </ContentControl>
                  </Grid>
                </Grid>
                <ContentControl Name="ContentTitle" Margin="0, -5, 0 , 0" Content="{TemplateBinding Label}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Style="{StaticResource AppBarText}" />
              </StackPanel>
            </Border>
            <Border Name="DisabledBackground" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Padding="{TemplateBinding Padding}" BorderThickness="0" BorderBrush="Transparent" Background="Transparent" Visibility="Collapsed">
              <StackPanel Orientation="{TemplateBinding Orientation}">
                <Grid Width="{TemplateBinding ButtonWidth}" Height="{TemplateBinding ButtonHeight}" Margin="0,-10, 0, 0">
                  <Grid Name="DisabledContentHost">
                    <ContentControl Name="DisabledContent" Foreground="{StaticResource DefaultDisabledBrush}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
                      <Grid Name="DisabledHolder" />
                    </ContentControl>
                  </Grid>
                </Grid>
                <ContentControl Content="{TemplateBinding Label}" Foreground="{StaticResource DefaultDisabledBrush}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{Binding Margin, ElementName=ContentTitle}" Style="{StaticResource AppBarText}" />
              </StackPanel>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:RoundButton">
    <Setter Property="BorderBrush" Value="{StaticResource DefaultForegroundBrush}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultForegroundBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource FontFamilySegoeSemiBold}" />
    <Setter Property="PressedBrush" Value="{StaticResource DefaultAccentBrush}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSizeExtraSmall}" />
    <Setter Property="ButtonWidth" Value="{StaticResource DefaultAppButtonSize}" />
    <Setter Property="ButtonHeight" Value="{StaticResource DefaultAppButtonSize}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:RoundButton">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="MouseOver" />
                <VisualState x:Name="Pressed">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonBackground">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PressedBrush, RelativeSource={RelativeSource TemplatedParent}}" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Stroke" Storyboard.TargetName="ButtonRing">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonBackground">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentBody">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentTitle">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Name="EnabledBackground" Padding="{TemplateBinding Padding}" BorderThickness="0" BorderBrush="Transparent" Background="Transparent">
              <StackPanel Orientation="{TemplateBinding Orientation}">
                <Grid Width="{TemplateBinding ButtonWidth}" Height="{TemplateBinding ButtonHeight}" Margin="0,-10, 0, 0">
                  <Ellipse x:Name="ButtonBackground" Stroke="Transparent" Fill="{TemplateBinding Background}" Margin="10" />
                  <Grid Name="ContentHost">
                    <ContentControl Name="ContentBody" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
                  </Grid>
                  <Ellipse x:Name="ButtonRing" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="3" Fill="Transparent" Margin="10" />
                </Grid>
                <ContentControl x:Name="ContentTitle" Content="{TemplateBinding Label}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Style="{StaticResource AppBarText}" />
              </StackPanel>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:RoundToggleButton">
    <Setter Property="BorderBrush" Value="{StaticResource DefaultForegroundBrush}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultForegroundBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource FontFamilySegoeSemiBold}" />
    <Setter Property="CheckedBrush" Value="{StaticResource DefaultAccentBrush}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSizeExtraSmall}" />
    <Setter Property="ButtonWidth" Value="{StaticResource DefaultAppButtonSize}" />
    <Setter Property="ButtonHeight" Value="{StaticResource DefaultAppButtonSize}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:RoundToggleButton">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CheckStates">
                <VisualState x:Name="Checked">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ButtonBackground">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{Binding CheckedBrush, RelativeSource={RelativeSource TemplatedParent}}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="DisabledButtonBackground">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="StrokeThickness" Storyboard.TargetName="DisabledButtonRing">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DisabledContent">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultContrastDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Unchecked" />
                <VisualState x:Name="Indeterminate" />
              </VisualStateGroup>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="EnabledBackground">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Collapsed</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DisabledBackground">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border Name="EnabledBackground" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Padding="{TemplateBinding Padding}" BorderThickness="0" BorderBrush="Transparent" Background="Transparent">
              <StackPanel Orientation="{TemplateBinding Orientation}">
                <Grid Width="{TemplateBinding ButtonWidth}" Height="{TemplateBinding ButtonHeight}" Margin="0,-10, 0, 0">
                  <Ellipse x:Name="ButtonBackground" Stroke="Transparent" Fill="{TemplateBinding Background}" Margin="10" />
                  <Grid Name="ContentHost">
                    <ContentControl Name="EnabledContent" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
                      <Grid Name="EnabledHolder">
                        <ContentControl Name="ContentBody" Content="{TemplateBinding Content}" />
                      </Grid>
                    </ContentControl>
                  </Grid>
                  <Ellipse x:Name="ButtonRing" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="3" Fill="Transparent" Margin="10" />
                </Grid>
                <ContentControl Name="ContentTitle" Margin="0, -5, 0 , 0" Content="{TemplateBinding Label}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Style="{StaticResource AppBarText}" />
              </StackPanel>
            </Border>
            <Border Name="DisabledBackground" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Padding="{TemplateBinding Padding}" BorderThickness="0" BorderBrush="Transparent" Background="Transparent" Visibility="Collapsed">
              <StackPanel Orientation="{TemplateBinding Orientation}">
                <Grid Width="{TemplateBinding ButtonWidth}" Height="{TemplateBinding ButtonHeight}" Margin="0,-10, 0, 0">
                  <Ellipse x:Name="DisabledButtonBackground" Stroke="Transparent" Margin="10" />
                  <Grid Name="DisabledContentHost">
                    <ContentControl Name="DisabledContent" Foreground="{StaticResource DefaultDisabledBrush}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
                      <Grid Name="DisabledHolder" />
                    </ContentControl>
                  </Grid>
                  <Ellipse x:Name="DisabledButtonRing" Stroke="{StaticResource DefaultDisabledBrush}" StrokeThickness="3" Fill="Transparent" Margin="10" />
                </Grid>
                <ContentControl Content="{TemplateBinding Label}" Foreground="{StaticResource DefaultDisabledBrush}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{Binding Margin, ElementName=ContentTitle}" Style="{StaticResource AppBarText}" />
              </StackPanel>
            </Border>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:Tile">
    <Setter Property="Background" Value="{StaticResource DefaultAccentBrush}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultForegroundBrush}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSizeNormal}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:Tile">
          <Grid Name="root" Background="{TemplateBinding Background}">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="MouseOver" />
                <VisualState x:Name="Pressed" />
                <VisualState x:Name="PointerOver" />
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="titleText">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultContrastDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="contentContainer">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultContrastDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="root">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <ContentControl Name="contentContainer" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Content="{TemplateBinding Content}" />
            <!-- 
							Label is an object but TextWrapping is TextBlock Only
							... this could blow up 
						-->
            <TextBlock Name="titleText" TextWrapping="{TemplateBinding TextWrapping}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" VerticalAlignment="Bottom" Padding="12, 0" Margin="0, 0, 0, 7" Text="{TemplateBinding Label}" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:TileNotification">
    <Setter Property="Background" Value="{StaticResource DefaultChromeBrush}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultForegroundBrush}" />
    <Setter Property="FontWeight" Value="SemiBold" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSizeNormal}" />
    <Setter Property="Margin" Value="5" />
    <Setter Property="Padding" Value="9, 0, 9, -1" />
    <Setter Property="VerticalAlignment" Value="Top" />
    <Setter Property="HorizontalAlignment" Value="Right" />
    <Setter Property="MinWidth" Value="28" />
    <Setter Property="MinHeight" Value="28" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:TileNotification">
          <Grid>
            <Rectangle Fill="{TemplateBinding Background}" RadiusX="14" RadiusY="14" />
            <ContentControl Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:ChatBubble">
    <Setter Property="Background" Value="{StaticResource DefaultAccentBrush}" />
    <Setter Property="FontFamily" Value="{StaticResource FontFamilySegoeNormal}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSizeMediumLarge}" />
    <Setter Property="BorderBrush" Value="{StaticResource DefaultAccentBrush}" />
    <Setter Property="BorderThickness" Value="{StaticResource DefaultBorderThickness}" />
    <Setter Property="Padding" Value="6, 2" />
    <Setter Property="HorizontalContentAlignment" Value="Left" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:ChatBubble">
          <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="MouseOver" />
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ContentBorder">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ContentBorder">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="LowerRightPath">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="LowerLeftPath">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="UpperRightPath">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="UpperLeftPath">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ChatBubbleDirectionStates">
                <VisualState x:Name="UpperRight">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="UpperRightPath">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="UpperLeft">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="UpperLeftPath">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="LowerRight">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="LowerRightPath">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="LowerLeft">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="LowerLeftPath">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
              <RowDefinition Height="Auto" />
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Border x:Name="ContentBorder" Grid.Row="1" Padding="{TemplateBinding Padding}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
              <ContentControl HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{StaticResource DefaultTextBoxInnerMargin}" Content="{TemplateBinding Content}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" />
            </Border>
            <Path Name="LowerRightPath" Data="M0,0 L1,1 L1,0 " Grid.Row="2" Fill="{TemplateBinding BorderBrush}" Stretch="Fill" Margin="12,0" Height="12" Width="18" Visibility="Collapsed" HorizontalAlignment="Right" />
            <Path Name="LowerLeftPath" Data="M0,0 L0,1 L1,0" Grid.Row="2" Fill="{TemplateBinding BorderBrush}" Stretch="Fill" Margin="12,0" Height="12" Width="18" Visibility="Collapsed" HorizontalAlignment="Left" />
            <Path Name="UpperLeftPath" Data="M0,0 L1,1 L0,1 " Grid.Row="0" Fill="{TemplateBinding BorderBrush}" Stretch="Fill" Margin="12,0" Height="12" Width="18" Visibility="Collapsed" HorizontalAlignment="Left" />
            <Path Name="UpperRightPath" Data="M0,1 L1,1 L1,0 " Grid.Row="0" Fill="{TemplateBinding BorderBrush}" Stretch="Fill" Margin="12,0" Height="12" Width="18" Visibility="Collapsed" HorizontalAlignment="Right" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:ChatBubbleTextBox">
    <Setter Property="FontFamily" Value="{StaticResource FontFamilySegoeNormal}" />
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSizeMediumLarge}" />
    <Setter Property="Background" Value="{StaticResource DefaultTextBoxBrush}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultTextBoxForegroundBrush}" />
    <Setter Property="BorderBrush" Value="{StaticResource DefaultTextBoxBrush}" />
    <Setter Property="BorderThickness" Value="{StaticResource DefaultBorderThickness}" />
    <Setter Property="Padding" Value="7, 4, 0, 4" />
    <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
    <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
    <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:ChatBubbleTextBox">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="ChatBubbleDirectionStates">
                <VisualState x:Name="UpperRight">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="UpperRightPath">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="UpperLeft">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="UpperLeftPath">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="LowerRight">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="LowerRightPath">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="LowerLeft">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="LowerLeftPath">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BackgroundElement">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxDisabledBackgroundThemeBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxDisabledBorderThemeBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentElement">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxDisabledForegroundThemeBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Normal">
                  <Storyboard>
                    <DoubleAnimation Duration="0" To="{StaticResource TextControlBackgroundThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundElement" />
                    <DoubleAnimation Duration="0" To="{StaticResource TextControlBorderThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BorderElement" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="PointerOver">
                  <Storyboard>
                    <DoubleAnimation Duration="0" To="{StaticResource TextControlPointerOverBackgroundThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundElement" />
                    <DoubleAnimation Duration="0" To="{StaticResource TextControlPointerOverBorderThemeOpacity}" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BorderElement" />
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="Focused">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultAccentBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
              <VisualStateGroup x:Name="ButtonStates">
                <VisualState x:Name="ButtonVisible">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="DeleteButton">
                      <DiscreteObjectKeyFrame KeyTime="0">
                        <DiscreteObjectKeyFrame.Value>
                          <Visibility>Visible</Visibility>
                        </DiscreteObjectKeyFrame.Value>
                      </DiscreteObjectKeyFrame>
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
                <VisualState x:Name="ButtonCollapsed" />
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
              <RowDefinition Height="Auto" />
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid Grid.Row="1">
              <Grid.Resources>
                <Style x:Name="DeleteButtonStyle" TargetType="Button">
                  <Setter Property="Template">
                    <Setter.Value>
                      <ControlTemplate TargetType="Button">
                        <Grid>
                          <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                              <VisualState x:Name="Normal" />
                              <VisualState x:Name="PointerOver">
                                <Storyboard>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BackgroundElement">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPointerOverBackgroundThemeBrush}" />
                                  </ObjectAnimationUsingKeyFrames>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPointerOverBorderThemeBrush}" />
                                  </ObjectAnimationUsingKeyFrames>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="GlyphElement">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPointerOverForegroundThemeBrush}" />
                                  </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                              </VisualState>
                              <VisualState x:Name="Pressed">
                                <Storyboard>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="BackgroundElement">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPressedBackgroundThemeBrush}" />
                                  </ObjectAnimationUsingKeyFrames>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="BorderElement">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPressedBorderThemeBrush}" />
                                  </ObjectAnimationUsingKeyFrames>
                                  <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="GlyphElement">
                                    <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource TextBoxButtonPressedForegroundThemeBrush}" />
                                  </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                              </VisualState>
                              <VisualState x:Name="Disabled">
                                <Storyboard>
                                  <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundElement" />
                                  <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BorderElement" />
                                </Storyboard>
                              </VisualState>
                            </VisualStateGroup>
                          </VisualStateManager.VisualStateGroups>
                          <Border Name="BorderElement" BorderBrush="{StaticResource TextBoxButtonBorderThemeBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
                          <Border Name="BackgroundElement" Background="{StaticResource TextBoxButtonBackgroundThemeBrush}" Margin="{TemplateBinding BorderThickness}">
                            <TextBlock Name="GlyphElement" Foreground="{StaticResource TextBoxButtonForegroundThemeBrush}" FontFamily="{StaticResource SymbolThemeFontFamily}" HorizontalAlignment="Center" Text="" VerticalAlignment="Center" />
                          </Border>
                        </Grid>
                      </ControlTemplate>
                    </Setter.Value>
                  </Setter>
                </Style>
              </Grid.Resources>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
              </Grid.ColumnDefinitions>
              <Border Name="BackgroundElement" Background="{TemplateBinding Background}" Margin="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" />
              <Border Name="BorderElement" Background="Transparent" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="2" />
              <TextBlock Opacity="0" Text="{TemplateBinding Text}" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" />
              <ScrollViewer Name="HintContentElement" Foreground="{StaticResource DefaultTextBoxReadOnlyBrush}" Content="{TemplateBinding Hint}" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" IsTabStop="False" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" ZoomMode="Disabled" />
              <ScrollViewer Name="ContentElement" HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" IsTabStop="False" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}" ZoomMode="Disabled" />
              <Button Name="DeleteButton" Style="{StaticResource DeleteButtonStyle}" BorderThickness="{TemplateBinding BorderThickness}" FontSize="{TemplateBinding FontSize}" IsTabStop="False" Visibility="Collapsed" VerticalAlignment="Stretch" Grid.Column="1" />
            </Grid>
            <Path Name="LowerRightPath" Data="M0,0 L1,1 L1,0 " Grid.Row="2" Fill="{Binding ElementName=BorderElement, Path=BorderBrush}" Opacity="{Binding ElementName=BorderElement, Path=Opacity}" Stretch="Fill" Margin="12,0" Height="12" Width="18" Visibility="Collapsed" HorizontalAlignment="Right" VerticalAlignment="Top" />
            <Path Name="LowerLeftPath" Data="M0,0 L0,1 L1,0" Grid.Row="2" Fill="{Binding ElementName=BorderElement, Path=BorderBrush}" Opacity="{Binding ElementName=BorderElement, Path=Opacity}" Stretch="Fill" Margin="12,0" Height="12" Width="18" Visibility="Collapsed" HorizontalAlignment="Left" VerticalAlignment="Top" />
            <Path Name="UpperLeftPath" Data="M0,0 L1,1 L0,1 " Grid.Row="0" Fill="{Binding ElementName=BorderElement, Path=BorderBrush}" Opacity="{Binding ElementName=BorderElement, Path=Opacity}" Stretch="Fill" Margin="12,0" Height="12" Width="18" Visibility="Collapsed" HorizontalAlignment="Left" VerticalAlignment="Bottom" />
            <Path Name="UpperRightPath" Data="M0,1 L1,1 L1,0 " Grid.Row="0" Fill="{Binding ElementName=BorderElement, Path=BorderBrush}" Opacity="{Binding ElementName=BorderElement, Path=Opacity}" Stretch="Fill" Margin="12,0" Height="12" Width="18" Visibility="Collapsed" HorizontalAlignment="Right" VerticalAlignment="Bottom" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:ColorHexagonPicker">
    <Setter Property="VerticalAlignment" Value="Center" />
    <Setter Property="HorizontalAlignment" Value="Center" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:ColorHexagonPicker">
          <StackPanel>
            <ContentPresenter Content="{TemplateBinding ColorBody}" />
            <ContentPresenter Content="{TemplateBinding GreyScaleBody}" />
          </StackPanel>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:ColorPicker">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:ColorPicker">
          <Grid>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedHueColor">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SampleSelector">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="0" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="SelectedColor">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="Auto" />
              <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
              <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Rectangle Margin="0,0,0,12" Height="24" Grid.Row="0" Grid.ColumnSpan="2" Name="SelectedColor" Fill="{TemplateBinding SolidColorBrush}" />
            <local:ColorSlider Width="24" Margin="0,0,12,0" IsColorVisible="false" Thumb="{TemplateBinding Thumb}" x:Name="ColorSlider" Grid.Row="2" />
            <Grid Name="Body" Grid.Column="1" Grid.Row="1">
              <Rectangle Name="SelectedHueColor" Fill="Red" />
              <Rectangle>
                <Rectangle.Fill>
                  <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                    <GradientStop Offset="0" Color="White" />
                    <GradientStop Offset="1" Color="Transparent" />
                  </LinearGradientBrush>
                </Rectangle.Fill>
              </Rectangle>
              <Rectangle>
                <Rectangle.Fill>
                  <LinearGradientBrush StartPoint="0,1" EndPoint="0, 0">
                    <GradientStop Offset="0" Color="Black" />
                    <GradientStop Offset="1" Color="Transparent" />
                  </LinearGradientBrush>
                </Rectangle.Fill>
              </Rectangle>
              <Grid Name="SampleSelector" VerticalAlignment="Top" HorizontalAlignment="Left">
                <Ellipse Height="22" Width="22" StrokeThickness="5" Stroke="Black" />
                <Ellipse Height="24" Width="24" StrokeThickness="3" Stroke="White" />
              </Grid>
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:ColorSliderThumb">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:ColorSliderThumb">
          <Grid>
            <Rectangle Stroke="Black" StrokeThickness="6" />
            <Rectangle Stroke="White" StrokeThickness="3" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="ColorSliderSuperSlider" TargetType="local:SuperSlider">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:SuperSlider">
          <Grid x:Name="Body">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="IsEnabledRectangle">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="IsEnabledRectangle">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultChromeBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="IsEnabledRectangle">
                      <DiscreteObjectKeyFrame KeyTime="0" Value=".5" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ThumbContentPresenter">
                      <DiscreteObjectKeyFrame KeyTime="0" Value=".75" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="BackgroundRectangle" Fill="{TemplateBinding Background}" />
            <Rectangle x:Name="ProgressRectangle" Fill="{TemplateBinding Foreground}" />
            <Rectangle x:Name="IsEnabledRectangle" Visibility="Collapsed" />
            <ContentPresenter Grid.Row="1" x:Name="ThumbContentPresenter" Content="{TemplateBinding Thumb}" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:ColorSlider">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:ColorSlider">
          <Grid Name="Body">
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="SelectedColor">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle Name="SelectedColor" Fill="{TemplateBinding SolidColorBrush}" />
            <local:SuperSlider x:Name="Slider" Orientation="{TemplateBinding Orientation}" Foreground="Transparent" Minimum="0" Maximum="360" Thumb="{TemplateBinding Thumb}" Style="{StaticResource ColorSliderSuperSlider}"></local:SuperSlider>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style x:Key="MetroFlowItemTextBlockStyle" TargetType="TextBlock">
    <Setter Property="FontSize" Value="{StaticResource DefaultFontSizeMediumLarge}" />
    <Setter Property="Margin" Value="12, 3, 0, 3" />
    <Setter Property="HorizontalAlignment" Value="Left" />
    <Setter Property="VerticalAlignment" Value="Bottom" />
  </Style>
  <Style x:Key="MetroFlowItemRectangleUnderlay" TargetType="Rectangle">
    <Setter Property="Fill" Value="{StaticResource DefaultChromeBrush}" />
    <Setter Property="Margin" Value="0, -.5" />
    <Setter Property="Opacity" Value=".8" />
  </Style>
  <Style x:Key="MetroFlowItemImage" TargetType="Image">
    <Setter Property="Margin" Value="0, -.5, 0, 0" />
    <Setter Property="Stretch" Value="UniformToFill" />
    <Setter Property="HorizontalAlignment" Value="Center" />
    <Setter Property="VerticalAlignment" Value="Center" />
  </Style>
  <Style x:Key="MetroFlowItemMainBody" TargetType="Panel">
    <Setter Property="Background" Value="{StaticResource DefaultChromeBrush}" />
    <Setter Property="Margin" Value="6, 0" />
  </Style>
  <Style TargetType="local:MetroFlowItem">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:MetroFlowItem">
          <Grid>
            <Grid Style="{StaticResource MetroFlowItemMainBody}">
              <Rectangle Fill="{StaticResource DefaultAccentBrush}" />
              <Image Source="{TemplateBinding ImageSource}" Visibility="{TemplateBinding ImageVisibility}" Opacity="{TemplateBinding ImageOpacity}" Style="{StaticResource MetroFlowItemImage}" />
              <Grid VerticalAlignment="Bottom">
                <Rectangle Style="{StaticResource MetroFlowItemRectangleUnderlay}" />
                <TextBlock Text="{TemplateBinding Title}" Visibility="{TemplateBinding TitleVisibility}" Opacity="{TemplateBinding TitleOpacity}" Style="{StaticResource MetroFlowItemTextBlockStyle}" />
                <TextBlock Text="{TemplateBinding ItemIndexString}" Visibility="{TemplateBinding ItemIndexVisibility}" Opacity="{TemplateBinding ItemIndexOpacity}" Style="{StaticResource MetroFlowItemTextBlockStyle}" />
              </Grid>
            </Grid>
            <Rectangle Fill="Transparent" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:MetroFlow">
    <Setter Property="Height" Value="120" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:MetroFlow">
          <Grid Name="LayoutRoot">
            <local:MetroFlowItem Title="MetroFlow Control" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:LockScreenPreview">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:LockScreenPreview">
          <Viewbox Stretch="Uniform">
            <Grid>
              <Grid Width="1344" Height="768">
                <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
                <local:SuperImage Source="{TemplateBinding LockScreenImageSource}" Stretch="UniformToFill" />
                <Rectangle Fill="Black" Opacity=".2" />
              </Grid>
              <Grid Margin="75, 0, 0, 0">
                <Grid.RowDefinitions>
                  <RowDefinition />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="Auto" />
                  <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <StackPanel Margin="0, 0, 0, -5" Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Orientation="Horizontal">
                  <TextBlock x:Name="TimeText" Text="18:49" Foreground="White" FontSize="145" FontWeight="Light" Margin="0, 0, 0, -15" />
                  <StackPanel VerticalAlignment="Bottom" Margin="0,0,0,22">
                    <TextBlock Text="{TemplateBinding TextLine1}" FontSize="17.7" Foreground="White" Visibility="{Binding Text, RelativeSource={RelativeSource Mode=Self}, Converter={StaticResource StringVisibilityConverter}}" FontFamily="Segoe UI Semilight" />
                    <TextBlock Text="{TemplateBinding TextLine2}" FontSize="17.7" Foreground="White" Visibility="{Binding Text, RelativeSource={RelativeSource Mode=Self}, Converter={StaticResource StringVisibilityConverter}}" FontFamily="Segoe UI Semilight" />
                    <TextBlock Text="{TemplateBinding TextLine3}" FontSize="17.7" Foreground="White" Visibility="{Binding Text, RelativeSource={RelativeSource Mode=Self}, Converter={StaticResource StringVisibilityConverter}}" FontFamily="Segoe UI Semilight" />
                  </StackPanel>
                </StackPanel>
                <StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" Margin="5, 0, 0, 20" Grid.Row="2">
                  <TextBlock x:Name="DayText" Text="Wednesday" FontSize="53.333" Foreground="White" FontWeight="Light" />
                  <TextBlock Text="," FontSize="53.333" Foreground="White" FontWeight="Light" />
                  <TextBlock x:Name="DateText" FontSize="53.333" FontWeight="Light" Foreground="White" Margin="6,2,0,-4" />
                </StackPanel>
                <StackPanel Orientation="Horizontal" Grid.Row="3" Margin="20, 0, 0, 60">
                  <Path Height="20" Stretch="Uniform" Fill="White" Data="F1 M 25.3333,23.7501L 28.4999,23.7501L 28.5,33.25L 25.3333,33.2501L 25.3333,23.7501 Z M 30.0833,25.3335L 33.2499,25.3335L 33.25,39.5834L 30.0833,39.5834L 28.5,41.1667L 28.5,50.6667L 25.3333,50.6667L 25.3333,41.1667L 23.75,39.5834L 20.5833,39.5835L 20.5832,25.3335L 23.7499,25.3335L 23.7499,34.8334L 24.5416,34.8334L 29.2916,34.8334L 30.0833,34.8334L 30.0833,25.3335 Z M 30.0833,47.5L 30.0833,44.3334L 50.6667,44.3334L 50.6667,30.0833L 34.8333,30.0834L 34.8333,26.9167L 55.4166,26.9167L 55.4166,47.5L 41.1666,47.5L 41.1667,50.6667L 45.125,50.6667L 45.9166,53.8333L 33.25,53.8333L 34.0417,50.6667L 38,50.6667L 38,47.5L 30.0833,47.5 Z " />
                  <Path Width="20" Stretch="Uniform" Fill="White" Data="F1 M 59,34L 59,42L 56,42L 56,48L 20,48L 20,28L 56,28L 56,34L 59,34 Z M 24,32L 24,44L 52,44L 52,32L 24,32 Z M 25,43L 25,33L 30,33L 35,43L 25,43 Z M 31.5,33L 39.5,33L 44.5,43L 36.5,43L 31.5,33 Z M 51,33L 51,43L 46,43L 41,33L 51,33 Z " Margin="22,0,0,0">
                    <Path.Projection>
                      <PlaneProjection RotationZ="90" />
                    </Path.Projection>
                  </Path>
                  <StackPanel Orientation="Horizontal" Margin="50,0,0,0" DataContext="{TemplateBinding ShowNotificationCount}" Visibility="{Binding Converter={StaticResource BoolVisibilityConverter}}">
                    <Image Source="{TemplateBinding NotificationIconSource}" Height="20" Stretch="Uniform" />
                    <TextBlock Text="4" FontSize="12" Margin="5, 15, 0, 0" />
                  </StackPanel>
                </StackPanel>
              </Grid>
            </Grid>
          </Viewbox>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:ProgressOverlay">
    <Setter Property="Background" Value="{StaticResource DefaultSemiTransparentBrush}" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:ProgressOverlay">
          <Grid Background="{TemplateBinding Background}" Name="LayoutGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Grid.Resources>
              <Storyboard x:Key="fadeOut" x:Name="FadeOutStoryboard">
                <DoubleAnimation Duration="0:0:0.5" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutGrid" />
              </Storyboard>
              <Storyboard x:Key="fadeIn" x:Name="FadeInStoryboard">
                <DoubleAnimation Duration="0:0:0.5" From="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutGrid" />
              </Storyboard>
            </Grid.Resources>
            <Rectangle Fill="Transparent" />
            <Grid>
              <ContentControl Content="{TemplateBinding Content}" HorizontalContentAlignment="Stretch" />
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:SuperImage">
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:SuperImage">
          <Grid>
            <Border x:Name="PlaceholderBorder" Opacity="{TemplateBinding PlaceholderOpacity}" Background="{TemplateBinding PlaceholderBackground}">
              <Image x:Name="PlaceholderImage" Source="{TemplateBinding PlaceholderImageSource}" Stretch="{TemplateBinding PlaceholderImageStretch}" />
            </Border>
            <Image x:Name="PrimaryImage" Source="{TemplateBinding Source}" Stretch="{TemplateBinding Stretch}" />
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
  <Style TargetType="local:SuperSlider">
    <Setter Property="Background" Value="{StaticResource DefaultChromeBrush}" />
    <Setter Property="Foreground" Value="{StaticResource DefaultAccentBrush}" />
    <Setter Property="Padding" Value="0, 3, 0, 36" />
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="local:SuperSlider">
          <Grid Name="Body">
            <Grid.RowDefinitions>
              <RowDefinition Height="Auto" />
              <RowDefinition />
            </Grid.RowDefinitions>
            <VisualStateManager.VisualStateGroups>
              <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Normal" />
                <VisualState x:Name="Disabled">
                  <Storyboard>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="ProgressRectangle">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultDisabledBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Fill" Storyboard.TargetName="BackgroundRectangle">
                      <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource DefaultChromeBrush}" />
                    </ObjectAnimationUsingKeyFrames>
                  </Storyboard>
                </VisualState>
              </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid Grid.Row="1">
              <Border Margin="{TemplateBinding Padding}">
                <Grid Name="BarBody">
                  <Rectangle Grid.Row="1" Name="BackgroundRectangle" Fill="{TemplateBinding Background}" />
                  <Rectangle Grid.Row="1" Name="ProgressRectangle" Fill="{TemplateBinding Foreground}" />
                  <ContentPresenter Grid.Row="1" Content="{TemplateBinding Thumb}" />
                </Grid>
              </Border>
            </Grid>
          </Grid>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>
</ResourceDictionary>